feat: submit batch sell quotes#8775
Conversation
7db77cd to
24c2026
Compare
580ef84 to
6686375
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
1fe7da4 to
2a6703f
Compare
8751708 to
403926e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 403926e. Configure here.
| } | ||
| // Default value | ||
| return true; | ||
| }; |
There was a problem hiding this comment.
Refactored shouldDisable7702 changes behavior for delegated gasless accounts
High Severity
The extracted shouldDisable7702 function has different behavior from the inline logic it replaced. When isDelegatedAccount=true and gasIncluded=true (but gasIncluded7702=false), the old code evaluated !isDelegatedAccount || gasIncluded → false || true → true (disable 7702). The new code returns false early at the isDelegatedAccount check, never reaching the gasIncluded guard. This means delegated accounts with gasless STX/sendBundle quotes now incorrectly get 7702 batching enabled instead of being kept on the STX path.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 403926e. Configure here.


Explanation
Client TODOs
BridgeController:getStateas an allowed messenger action for the bridge-status-controllersubmitTx(extension only)isBatchSellTradeAvailable=trueto enable submit buttonsubmitBatchSellparams are the same assubmitTx, except clients need to pass a list of the recommendedQuotes instead of a single quoteReferences
Checklist
Note
High Risk
Breaking API and messenger changes plus multi-tx submission, EIP-7702 batching, and history-keying logic that affects swap/bridge activity and analytics accuracy.
Overview
Adds end-to-end BatchSell submission:
BridgeStatusController:submitBatchSellloadsbatchSellTradesfromBridgeController:getStateand routes multi-quote flows through a newsubmitBatchSellHandler(non-atomic batches, STX vs EIP-7702 via sharedshouldDisable7702).bridge-status-controller extends
submitTxand all submit strategies to accept arrays of quotes plus optionalbatchSellTrades; history now storesbatchSellData,quoteIds(7702 delegation), and per-trade keys for STX. New exports:getBatchSellHistoryItemsForTxHash,isBatchSellHistoryItem. BatchSell batches no longer match history bybatchIdalone (avoids marking sibling trades complete/failed early). Swap completion/failure recordscompletionTimeforactual_time_minutesmetrics; nested swap txs are treated like swaps.bridge-controller extends
BatchSellTradesResponsevalidation withgasIncluded/gasIncluded7702(GaslessPropertiesSchema), removes deprecatedBridgeUserAction/BridgeBackgroundActionexports, and tightens quote metadata types for metrics.Breaking for integrators: allow
BridgeController:getStateon the status controller messenger; wiresubmitBatchSellwith recommended quote list (same params assubmitTxotherwise).Reviewed by Cursor Bugbot for commit 403926e. Bugbot is set up for automated code reviews on this repo. Configure here.